.tabulator {
    font-size: var(--bs-body-font-size);
}

button.tabulator-page {
    font-size: var(--bs-body-font-size);
}

.tabulator-row .tabulator-responsive-collapse table {
    font-size: var(--bs-body-font-size);
}

.tabulator-popup-container {
    font-size: var(--bs-body-font-size);
}

.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tabulator-row .tabulator-cell.tabulator-editing input:focus, .tabulator-row .tabulator-cell.tabulator-editing select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgb(13 110 253 / 25%);
}

.tabulator-row .tabulator-cell.tabulator-editing {
    border-right: 1px solid #1d68cd !important;
    padding: 6px !important;
}

.tabulator.table-bordered > .tabulator-tableHolder > * > *, .tabulator.table-bordered > .tabulator-tableholder > * > * {
    border-bottom: 1px solid #dee2e6;
}

.tabulator .tabulator-footer {
    background-color: inherit;
}

.tabulator.table-sm > :not(caption) > * > * {
    padding: 0;
}

.tabulator-row.tabulator-row-even {
    background-color: inherit;
}

@media (hover:hover) and (pointer:fine) {
    .tabulator.table-striped:not(.table) .tabulator-row.tabulator-row-even.tabulator-selectable:hover {
        background-color:#e9ecef;
    }
    .tabulator.table-striped:not(.table) .tabulator-row.tabulator-row-even.tabulator-selected:hover {
        background-color:#9abcea;
    }
    .tabulator-row.tabulator-selectable:hover {
        background-color:inherit;
    }
    .tabulator-row.tabulator-selected:hover {
        background-color:#9abcea;
    }

    .tabulator.table-hover.table-striped:not(.table) .tabulator-row.tabulator-row-even.tabulator-selectable:hover {
        background-color:#ced4da;
    }
    .tabulator.table-hover.table-striped:not(.table) .tabulator-row.tabulator-row-even.tabulator-selected:hover {
        background-color:#769bcc;
    }
    .tabulator.table-hover:not(.table) .tabulator-row.tabulator-selectable:hover {
        background-color:#ced4da;
    }
    .tabulator.table-hover:not(.table) .tabulator-row.tabulator-selected:hover {
        background-color:#769bcc;
    }
}

.tabulator-row .tabulator-cell.tabulator-editing select {
    cursor: pointer;
}

.tabulator-row .tabulator-cell.tabulator-editing select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent none no-repeat;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-position: right .75rem center;
    background-size: 16px 12px;
}

.tabulator-row .tabulator-cell.tabulator-editing input.form-check-input:checked[type="checkbox"] {
    background-color: var(--bs-primary, #0d6efd);
    background-image: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 20 20%27%3e%3cpath fill=%27none%27 stroke=%27%23fff%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%273%27 d=%27m6 10 3 3 6-6%27/%3e%3c/svg%3e");
    border-color: var(--bs-primary, #0d6efd);
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col, [data-bs-theme="dark"] .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell, [data-bs-theme="dark"] .tabulator .tabulator-tableholder, [data-bs-theme="dark"] .tabulator .tabulator-footer {
    background-color: var(--bs-body-bg, #212529);
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover {
    background-color: var(--bs-secondary-bg, #343a40);
}
